package com.jhx.video.service

import com.jhx.common.http.HttpResponse
import com.jhx.video.model.VideoArray
import retrofit2.Call
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

/**
 *
 *
 * @author Jack 2018-03-07 18:26
 */
interface VideoService {

    /**
     * 发布视频
     *
     * @param desc 视频描述
     * @param videoId 腾讯云返回的id
     * @param videoUrl 视频地址
     * @param time 视频时长
     */
    @FormUrlEncoded
    @POST("businessCenter/publishSmallVideo")
    fun postVideo(@Field("context") desc: String,
                  @Field("videoUrl") videoUrl: String,
                  @Field("coverUrl") coverUrl: String,
                  @Field("file_id") videoId: String,
                  @Field("vTime") time: String): Call<HttpResponse<Any>>

    /**
     * 获取签名
     */
    @FormUrlEncoded
    @POST("businessCenter/txsign")
    fun getSignature(@Field("Nothing") nothing: String? = null): Call<HttpResponse<Any>>

    /**
     * 获取视频列表
     */
    @FormUrlEncoded
    @POST("businessCenter/getShortVideoList")
    fun getVideoList(@Field("pageIndex") pageIndex: Int = 1,
                     @Field("pageSize") pageSize: Int = 10): Call<HttpResponse<VideoArray>>

    /**
     * 置顶视频
     */
    @FormUrlEncoded
    @POST("businessCenter/updateVideoToTop")
    fun stickVideo(@Field("vid") vid: String,
                   @Field("isTop") isTop: Int): Call<HttpResponse<Any>>

    /**
     * 删除视频
     */
    @FormUrlEncoded
    @POST("businessCenter/delVideo")
    fun deleteVideo(@Field("vid") vid: String): Call<HttpResponse<Any>>
}